﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace LuaCodeStyler
{
	public partial class TextBoxEx : TextBox
	{
		public TextBoxEx()
		{
			InitializeComponent();
		}

		private void textBox_KeyDown(object sender, System.Windows.Forms.KeyEventArgs e)
		{
			if (e.Control && e.KeyCode == Keys.A)
			{
				(sender as TextBox).SelectAll();
				keyHandled = true;
			}
		}
		private void textBox_KeyPress(object sender, KeyPressEventArgs e)
		{
			if (keyHandled)
			{
				e.Handled = true;
				keyHandled = false;
			}
		}

		private bool keyHandled;
	}
}
